package site.marqstree.latte.ec.main.sort;

import android.os.Bundle;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import butterknife.BindView;
import site.marqstree.latte.core.delegates.bottom.BottomItemDelegate;
import site.marqstree.latte.ec.R;
import site.marqstree.latte.ec.R2;
import site.marqstree.latte.ec.main.sort.content.ContentDelegate;
import site.marqstree.latte.ec.main.sort.list.VerticalListDelegate;

/*
 * 项目名: EleCommerce
 * 包名: site.marqstree.latte.ec.main.sort
 * 文件名: SortDelegate
 * 创建者: marqstree
 * 创建时间: 2020/1/21 17:09
 * 描述: TODO
 */
public class SortDelegate extends BottomItemDelegate {

    @Override
    public Object setLayout() {
        return R.layout.delegate_sort;
    }

    @Override
    public void onBindView(@Nullable Bundle savedInstanceState, @NonNull View rootView) {
    }

    @Override
    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);
        final VerticalListDelegate listDelegate = new VerticalListDelegate();
        //填充左侧列表Fragment
        getSupportDelegate().loadRootFragment(R.id.vertical_list_container, listDelegate);
        //填充右侧明细
        //设置右侧第一个分类显示，默认显示分类一
        getSupportDelegate().loadRootFragment(R.id.sort_content_container, ContentDelegate.newInstance(1));
    }
}
